var WxParse = require('../../wxParse/wxParse.js');
const app = getApp();

Page({
    data: {
      zhaji_list: []
    },
    onLoad() {
      this.zhajiList();
    },
    // 感悟札记列表
    zhajiList() {
      let post = {
        page: 1,
        perpage: 1000
      };

      app.ajax('index/zhajiList', post, res => {
        app.format_img_arr(res);
        this.setData({ zhaji_list: res });
      });
    },
    // 切换新闻展开/收起
    toggle_news() {
      this.setData({ zhaji_open: !this.data.zhaji_open });
    },
    // 去札记详情
    to_news_detail(e) {
      wx.navigateTo({ url: '/pages/zaji-detail/zaji-detail?id=' + e.currentTarget.dataset.id });
    }
  }
);